package cn.ustb.serviceImpl;

import cn.ustb.dao.PostponeExamApplyDao;
import cn.ustb.entity.PostponeExamApply;
import cn.ustb.service.PostponeExamApplyService;
import cn.ustb.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * @author yuyan
 */
public class PostponeExamServiceImpl implements PostponeExamApplyService {
    @Override
    public void insert(PostponeExamApply postponeExamApply) {
        SqlSession sqlSession=null;
        try{
            sqlSession = MyBatisUtil.getInstance();
            PostponeExamApplyDao postponeExamApplyDao=sqlSession.getMapper(PostponeExamApplyDao.class);
            postponeExamApplyDao.insert(postponeExamApply);
            sqlSession.commit();
        }catch (Exception e){
            if(sqlSession!=null){
                sqlSession.rollback();
            }

        }finally {
            if(sqlSession!=null){
                sqlSession.close();
            }
        }
    }
}
